<template>
	<view>
		<view class="swpric">
			<up-swiper :list="list1" indicator indicatorMode="dot" height="750rpx"></up-swiper>
		</view>
		<view class="setit">
			<view class="title">{{list.name}}</view>
			<view class="tetx">{{list.intro}}</view>
			<view class="pric">{{list.member_price}}<text style="font-size: 14px;"></text></view>
			<view class="box">
				<view class="">运费：包邮</view>
				<view class="">剩余：{{list.goods_num}}</view>
			</view>
		</view>
		<view style="height: 20rpx;background-color: #fafafa;"></view>
		<view class="exchange">
			<view class="feenx">
				<!-- <view class="fenx1" @click=" "><up-icon name="share-square" size="20"></up-icon>
					<view class="">分享</view>
				</view> -->
				<button open-type="share">
					<u-icon name="share-square" size="20"></u-icon>
					<text>分享</text>
				</button>
				<button open-type="contact">
					<u-icon name="server-fill" size="20"></u-icon>
					<text>客服</text>
				</button>
				<!-- <view class="fenx1"><up-icon name="server-fill" size="20"></up-icon>
					<view class="">客服</view>
				</view> -->
			</view>
			<view class="buttmon" @click="gotoconve(venueId)">立即下单</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue';
	import request from '../../utils/request';
	import {
		onLoad
	} from '@dcloudio/uni-app'
	onLoad(() => {
		token.value = uni.getStorageSync('token')
		const options = getCurrentPages().pop().options;
		if (options && options.id) {
			venueId.value = decodeURIComponent(options.id)
			console.log(venueId.value);
			request.get('Productlists/read', {
				data: {
					id: venueId.value
				},
				header: {
					"token": token.value
				}
			}).then(res => {
				console.log(res);
				list.value = res.data
				list1.value = res.data.pics
				console.log(list1.value);
			}).catch(err => {
				console.log(err);
			})
		}
	})
	let token = ref()
	let venueId = ref()
	let list = ref()
	let list1 = ref([
		// '/static/logo.png'
	])
	const gotoconve = (venueId) => {
		// console.log(venueId);
		const id = venueId
		// console.log(id);
		uni.navigateTo({
			url: `/pages/convert/convert?id=${id}`
		})
	}
</script>

<style scoped lang="scss">
	.swpric {
		width: 100%;
		height: 750rpx;
	}

	.setit {
		width: 100%;
		height: 370rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.title {
		width: 100%;
		height: 110rpx;
		line-height: 100rpx;
	}

	.tetx {
		font-size: 12px;
		color: #b6b6b6;
	}

	.pric {
		width: 100%;
		height: 130rpx;
		line-height: 130rpx;
		color: #10c696;
		font-size: 20px
	}

	.box {
		font-size: 12px;
		color: #ababab;
		display: flex;
		align-items: center;
		justify-content: space-between;

	}

	.exchange {
		width: 100%;
		height: 100rpx;
		position: fixed;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.feenx {
		display: flex;
		align-items: center;
	}

	.fenx1 {
		display: flex;
		flex-direction: column;
		font-size: 14px;
		align-items: center;
		margin-left: 40rpx;
	}

	button {
		padding: 0 !important;
		background-color: transparent;
		display: flex;
		flex-direction: column;
		font-size: 14px;
		align-items: center;
		margin-left: 40rpx;

		&::after {
			border: 0 !important;
		}
	}

	.buttmon {
		width: 300rpx;
		height: 90rpx;
		line-height: 85rpx;
		background-color: #10c696;
		color: #fff;
		text-align: center;
		border-radius: 40rpx;
	}
</style>